package com.otupia.wui.service;

import java.util.List;

import com.otupia.acs.entity.UserInfo;
import com.otupia.acs.locator.Locator;
import com.otupia.acs.spring.api.FriendManager;

public class FriendServiceBean implements FriendService
{
	private Locator locator;

	public Locator getLocator()
	{
		return locator;
	}

	public void setLocator(Locator locator)
	{
		this.locator = locator;
	}

	private FriendManager friendManager = (FriendManager) locator
			.getBean("FriendManagerBean/remote");

	public void addFriend(long userId, long friendId)
	{
		friendManager.addFriend(userId, friendId);
	}

	public void deleteFriend(long userId, long friendId)
	{
		friendManager.deleteFriend(userId, friendId);

	}

	public List<UserInfo> selectFriendList(long userId)
	{
		List<UserInfo> friendList;
		friendList = friendManager.selectFriend(userId);
		return friendList;
	}

}
